package com.zhaopin.mianshi;

import java.util.concurrent.TimeUnit;

/**
 * @author yin.peide
 * @date 2021-05-07 15:19
 */
public class MainTest {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            while (true) {
                try {
                    TimeUnit.SECONDS.sleep(1);
                    System.out.println("我还活着。。。");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

            }
        });

        thread.start();

        TimeUnit.SECONDS.sleep(2);
        System.out.println(" I am out...");
    }
}
